home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 5 / BBS in a Box -Volume V (BBS in a Box) (April 1992).iso / Files / Prog / M / Mac gperf 1.9.cpt / Mac gperf 1.9 / src / perfect.h < prev    next >
Encoding:
C/C++ Source or Header  |  1991-03-09  |  1.8 KB  |  51 lines  |  [TEXT/KAHL]

  1. /* Provides high-level routines to manipulate the keywork list 
  2.    structures the code generation output. 
  3.  
  4.    Copyright (C) 1989 Free Software Foundation, Inc.
  5.    written by Douglas C. Schmidt (schmidt@ics.uci.edu)
  6.  
  7. This file is part of GNU GPERF.
  8.  
  9. GNU GPERF is free software; you can redistribute it and/or modify
  10. it under the terms of the GNU General Public License as published by
  11. the Free Software Foundation; either version 1, or (at your option)
  12. any later version.
  13.  
  14. GNU GPERF is distributed in the hope that it will be useful,
  15. but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  17. GNU General Public License for more details.
  18.  
  19. You should have received a copy of the GNU General Public License
  20. along with GNU GPERF; see the file COPYING.  If not, write to
  21. the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
  22.  
  23. #ifndef _perfect_h
  24. #define _perfect_h
  25. #define _H_perfect
  26.  
  27. #include "prototype.h"
  28. #include "keylist.h"
  29. #include "boolarray.h"
  30.  
  31. typedef struct perfect
  32. {
  33.     KEY_LIST    list;                /* List of key words provided by the user. */
  34.     BOOL_ARRAY    duplicate;            /* Speeds up check for redundant hash values. */
  35.     int            max_hash_value;        /* Maximum possible hash value. */
  36.     int            fewest_hits;        /* Records fewest # of collisions for asso value. */
  37.     int            best_char_choice;    /* Best (but not optimal) char index found so far. */
  38.     int            best_asso_value;    /* Best (but not optimal) asso value found so far. */
  39. } PERFECT;
  40.  
  41. extern    void perfect_init( void );
  42. extern    void perfect_destroy( void );
  43. extern    int  perfect_generate( void );
  44. extern    void perfect_print( void );
  45.  
  46.  
  47. extern    int        occurrences[ALPHABET_SIZE]; /* Counts occurrences of each key set character. */
  48. extern    int        asso_values[ALPHABET_SIZE]; /* Value associated with each character. */
  49.  
  50. #endif /* _perfect_h */
  51.